package com.minelx.scriptbuilder.script.operation;

import com.minelx.scriptbuilder.script.IVariable;
import com.minelx.scriptbuilder.script.ScriptContext;

public class ReturnOperation implements IOperation {

	private final ScriptContext context;

	private final IVariable returnVariable;

	public ReturnOperation(ScriptContext context, IVariable returnVariable) {
		this.context = context;
		this.returnVariable = returnVariable;
	}

	@Override
	public void execute() {
		context.functionFrame().returns(returnVariable.value());
	}
}
